/**
 * 
 * @param {Array} menuList 
 * @param {Array} aggregate 
 * @returns {Array} 
 */

const cancanneed = (menuList = [], aggregate = []) =>{
  let userRoutes = [];
  menuList.forEach(item => {
    aggregate.forEach(routes => {
      if (item.name === routes.meta.name) {
        if (item.children && item.children.length >0) {
          routes.children = cancanneed(item.children, routes.children)
        }
        userRoutes.push(routes)
      }
    })
  })
  return userRoutes
}
export default cancanneed